import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

import '../../../constants.dart';

class ProfileMenu extends StatelessWidget {
  const ProfileMenu({
    Key key,
    @required this.text,
    @required this.icon,
    this.press,
  }) : super(key: key);

  final String text, icon;
  final VoidCallback press;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
      // child: TextButton.icon(
      //   onPressed: press,
      //   icon: Icon(Icons.arrow_forward_ios),
      //   label: Text(text),
      // ),
      child: ColoredBox(
        color: Color(0xFFF5F6F9),
        child: TextButton(
          onPressed: press,
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SvgPicture.asset(
                  icon,
                  color: kPrimaryColor,
                  width: 22,
                ),
                SizedBox(width: 20),
                Expanded(
                  child: Text(
                    text,
                    style: TextStyle(
                      color: Colors.black54,
                      fontSize: 20,
                    ),
                  ),
                ),
                Icon(Icons.arrow_forward_ios, color: Colors.black54),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
